<template>
	<view>
		<u-tabs :list="navList" :current="current" :is-scroll="false" @change="tabsCurrent"></u-tabs>
		
		
		
		<view v-if="!current">
			<view class="u-padding-20">
				<view class="u-font-weight">提现金额</view>
				<view class="u-flex">
					<view class="u-margin-right-10">￥</view>
					<view class="u-margin-top-20 u-margin-bottom-20">
						<u-input placeholder="请输入提现金额" v-model="wx.money" ></u-input>
					</view>
					
				</view>
				<w-upload v-model="wx.qr" :number='1'></w-upload>
			</view>
		</view>
		
		
		<view v-else>
			<view class="u-padding-20">
				<view class="u-font-weight">提现金额</view>
				<view class="u-flex">
					<view class="u-margin-right-10">￥</view>
					<view class="u-margin-top-20 u-margin-bottom-20">
						<u-input placeholder="请输入提现金额" v-model="card.money" ></u-input>
					</view>
					
				</view>
				<view class="u-font-weight">持卡人姓名</view>
				<view class="u-flex">
					<view class="u-margin-top-20 u-margin-bottom-20">
						<u-input placeholder="请输入持卡人姓名" v-model="card.name" ></u-input>
					</view>
				</view>
				
				<view class="u-font-weight">持卡人卡号</view>
				<view class="u-flex">
					<view class="u-margin-top-20 u-margin-bottom-20">
						<u-input placeholder="请输入持卡人卡号" v-model="card.qr" ></u-input>
					</view>
				</view>
				
				<view class="u-font-weight">开户行</view>
				<view class="u-flex">
					<view class="u-margin-top-20 u-margin-bottom-20">
						<u-input placeholder="请输入开户行" v-model="card.bank" ></u-input>
					</view>
				</view>
				
				
				
			</view>
		</view>
		
		
		<view style="width: 700rpx;margin: auto;">
			<u-button type="primary" @click="submit">提交</u-button>
		</view>
		<u-toast ref="uToast" />
	
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				navList: [{
						name: "微信"
					},
					{
						name: "银行卡"
					},
			
				],
				current: 0,
				
				wx:{
					type:1,
					money:'',
					qr:''
				},
				card:{
					type:2,
					money:'',
					bank:'',
					name:'',
					qr:""
				}
		
				
			}
		},
		methods:{
			tabsCurrent(e){
				this.current=e
			},
			
			submit(){
				let data=this.current?this.card:this.wx;
				this.$u.post('/teacher/withdraw', data).then(res => {
					this.$refs.uToast.show({
						title: '提交成功',
						type: 'success',
						back:true
					})
				}).catch(err => {
					
				})
				
			}
		}
	}
</script>

<style>
</style>
